# -*- coding: utf-8 -*-
# @Date    : 2022-04-02 11:05:05
# @Author  : BrightSoul (653538096@qq.com)


import os
import PythonMagick
 
img_path = "01c0b7905241ca0a218b74bca42bffca238e214b54d8-pPPlyZ_fw658.webp"


img = PythonMagick.Image(img_path)
# 这里要设置一下尺寸，不然会报ico尺寸异常错误
img.sample('128x128')
img.write(f'{img_path}.ico')